-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PM-14921]Customers managed by a Reseller need to see how many seats are in their subscription, while still obfuscating the cost of subscription. #12726
Conversation
…d-to-see-how-many-seats
Great job, no security vulnerabilities found in this Pull Request |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #12726 +/- ##
==========================================
- Coverage 35.51% 35.49% -0.02%
==========================================
Files 3008 3008
Lines 90920 90929 +9
Branches 16912 16914 +2
==========================================
- Hits 32286 32279 -7
- Misses 56132 56148 +16
Partials 2502 2502 ☔ View full report in Codecov by Sentry. |
…d-to-see-how-many-seats
…d-to-see-how-many-seats
…d-to-see-how-many-seats
e12b044
…d-to-see-how-many-seats
apps/web/src/app/billing/organizations/organization-subscription-cloud.component.ts
Outdated
Show resolved
Hide resolved
apps/web/src/app/billing/organizations/organization-subscription-cloud.component.ts
Outdated
Show resolved
Hide resolved
apps/web/src/app/billing/organizations/organization-subscription-cloud.component.html
Outdated
Show resolved
Hide resolved
…managed-by-a-reseller-need-to-see-how-many-seats' into pm-14921-customers-managed-by-a-reseller-need-to-see-how-many-seats
…d-to-see-how-many-seats
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for resolving those. I think we still have some cleanup we can do to make this clearer.
Based on my understanding of the PR, you're adding the seat usage message only if the Organization
has a reseller.
As such, there's no reason to trigger your getAllUsers
function unless the organization has a reseller to begin with.
Basically, what I think would be simplest would be:
- Declare a
string
property calledresellerSeatsRemainingMessage
. - In the
ngOnInit
, if theOrganization
has a reseller, you'd invoke some of the logic from your existinggetAllUsers
method, but just use it to set the new string property you created:
const allUsers = await this.organizationUserApiService.getAllUsers(this.userOrg.id);
const userCount = allUsers.data.filter((user) =>
[
OrganizationUserStatusType.Invited,
OrganizationUserStatusType.Accepted,
OrganizationUserStatusType.Confirmed,
].includes(user.status),
).length;
const remainingSeats = this.userOrg.seats - userCount;
this.resellerSeatsRemainingMessage = this.i18nService.t(
"seatsRemaining",
remainingSeats.toString(),
this.userOrg.seats.toString(),
);
Then, in your HTML, you can check *ngIf="userOrg.hasReseller && resellerSeatsRemainingMessage"
.
Feel free to keep that logic that constructs the seats remaining message in a separate method, but if you do, I'd rename it to be more clear since it's not really just getting all users. It'd be more something like getResellerSeatsRemaining
or something along those lines.
Then, you can also remove the seatUsageMessage
which is just a property pointed at another property.
…d-to-see-how-many-seats
…d-to-see-how-many-seats
…d-to-see-how-many-seats
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, nice work and thank you for the updates.
…d-to-see-how-many-seats
…d-to-see-how-many-seats
🎟️ Tracking
https://bitwarden.atlassian.net/browse/PM-14921
📔 Objective
Customers who are now being added as a Reseller Managed Account in our new system can no longer see the amount of seats they are paying for, or how many seats they have active.
The result would be to allow those account owners to see their number of active seats and purchase seats, while still obfuscating the billing details to ensure the Reseller pricing is not available.
📸 Screenshots
Screen.Recording.2025-01-07.at.13.32.38.mov
⏰ Reminders before review
🦮 Reviewer guidelines
:+1:
) or similar for great changes:memo:
) or ℹ️ (:information_source:
) for notes or general info:question:
) for questions:thinking:
) or 💭 (:thought_balloon:
) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion:art:
) for suggestions / improvements:x:
) or:warning:
) for more significant problems or concerns needing attention:seedling:
) or ♻️ (:recycle:
) for future improvements or indications of technical debt:pick:
) for minor or nitpick changes